BASIC User Group > Code Challenges

Simple Question

<< < (3/3)

jalih:

--- Quote from: John on January 07, 2019, 01:41:16 am ---
--- Code: Script BASIC ---PRINT 9999999999999999.0 - 9999999999999998.0,"\n" 
What does your language return?

--- End quote ---

With compile-time option: LIMITS(FIXEDDEC(31));

I can do following with my old PL/I compiler and get the correct result:


--- Code: ---put skip list(999999999999999999999999999999.0 - 999999999999999999999999999998.0);

--- End code ---

John:

--- Quote ---The number 9,223,372,036,854,775,807, equivalent to the hexadecimal value 7FFF,FFFF,FFFF,FFFF16, is the maximum value for a 64-bit signed integer in computing.
--- End quote ---

AIR:
With GO, I get the following:


--- Code: Go ---num := 9999999999999999.0 - 9999999999999998.0fmt.Printf("num Type = %T, num Value = %g\n", num, num)
num Type = float64, num Value = 1

Navigation

[0] Message Index

[*] Previous page

Go to full version