Stop Microsoft

Miscellaneous => Programming & Networking => Topic started by: Fett101 on 24 February 2004, 07:15

Title: A little C help
Post by: Fett101 on 24 February 2004, 07:15
Doing this thing to calculate the number of seconds since a given year using int and then float. They're both giving me different numbers.

Code: [Select]

Gives 31536000 like it should.

Code: [Select]

gives me 13184.

Perhaps it's just the data type limitation, but I coulda sworn int's could hold larger numbers...
Title: A little C help
Post by: Fett101 on 24 February 2004, 07:32
NM. Is the data type. Thanks for coming. Have a safe drive home.
Title: A little C help
Post by: Paladin9 on 24 February 2004, 12:17
Nice
Title: A little C help
Post by: flap on 24 February 2004, 16:02
Actually either should work. The maximum value of a 32 bit integer is about 2 billion.
Title: A little C help
Post by: Fett101 on 24 February 2004, 18:05
I changed it to a long an it works fine now.
Title: A little C help
Post by: flap on 24 February 2004, 18:42
Are you using a 16-bit compiler?
Title: A little C help
Post by: Fett101 on 24 February 2004, 23:48
Yes. Really old POC.