Re: ver 4.0 found the BUG in WIN98 code

new topic     » goto parent     » topic index » view thread      » older message » newer message

Bloody hell Bernie! Are trying to make helping you difficult!?

Let's see if I can get a straight and complete answer this time...

You are getting -2147483648 when you use "sprintf".

You are also getting -2147483648 when you use "printf".

In other words, the program below ...

puts(1, sprintf("%d", 3217040639)) 
puts(1, " : from sprintf\n") 
printf(1, "%d : from printf\n", 3217040639) 

Shows the following on your screen...

-2147483648 : from sprintf 
-2147483648 : from printf 

Can you run the following two programs for me ...

-- Program 1 
atom a 
a = 3217040635 
for i = 1 to 10 do 
   puts(1, sprintf("%d: %d", {i, a})) 
   puts(1, "\n") 
   a += 1 
end for 
-- Program 2 
atom a 
a = -2147483645 
for i = 1 to 10 do 
   puts(1, sprintf("%d: %d", {i, a})) 
   puts(1, "\n") 
   a += 1 
end for 

And show us the results you are getting.

By the way, 0x80000000 when stored in a C long integer represents a sequence that has not been allocated any memory in Euphoria. It does NOT represent the lowest Euphoria integer value.

The value 0x800000000 when stored in Euphoria is actually stored as a C double and not a C int.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu