Author Topic: A little C help  (Read 2164 times)

Fett101

  • VIP
  • Member
  • ***
  • Posts: 1,581
  • Kudos: 85
    • http://fgmma.com
A little C help
« 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...

Fett101

  • VIP
  • Member
  • ***
  • Posts: 1,581
  • Kudos: 85
    • http://fgmma.com
A little C help
« Reply #1 on: 24 February 2004, 07:32 »
NM. Is the data type. Thanks for coming. Have a safe drive home.

Paladin9

  • VIP
  • Member
  • ***
  • Posts: 696
  • Kudos: 263
A little C help
« Reply #2 on: 24 February 2004, 12:17 »
Nice
_________________________________________________
 
To create a new standard, it takes something that's not just a little bit different; it takes something that's really new and really captures people's imagination

flap

  • Member
  • **
  • Posts: 1,268
  • Kudos: 137
A little C help
« Reply #3 on: 24 February 2004, 16:02 »
Actually either should work. The maximum value of a 32 bit integer is about 2 billion.
"While envisaging the destruction of imperialism, it is necessary to identify its head, which is none other than the United States of America." - Ernesto Che Guevara

http://counterpunch.org
http://globalresearch.ca


Fett101

  • VIP
  • Member
  • ***
  • Posts: 1,581
  • Kudos: 85
    • http://fgmma.com
A little C help
« Reply #4 on: 24 February 2004, 18:05 »
I changed it to a long an it works fine now.

flap

  • Member
  • **
  • Posts: 1,268
  • Kudos: 137
A little C help
« Reply #5 on: 24 February 2004, 18:42 »
Are you using a 16-bit compiler?
"While envisaging the destruction of imperialism, it is necessary to identify its head, which is none other than the United States of America." - Ernesto Che Guevara

http://counterpunch.org
http://globalresearch.ca


Fett101

  • VIP
  • Member
  • ***
  • Posts: 1,581
  • Kudos: 85
    • http://fgmma.com
A little C help
« Reply #6 on: 24 February 2004, 23:48 »
Yes. Really old POC.