|
||||||
| General Programming Non language specific, Assembly, Linux/Unix, Mac and anything not covered in other topics. Talk about Programming Theory here. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||||
|
Yes, under most languages. When you multiply by 1000, you are not dealing with real multiplication. As a result you will start getting rollovers and hit negative values.
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum Programming is a branch of mathematics. |
|
|||||
|
Elaborating on what IcePack said:
you start at 1, then get 1000, then 1,000,000, then 1,000,000,000, then 1,000,000,000,000 which is outside the range supported by an integer. The high bits get thrown out and you get a completely different number, possibly interpretted as positive or negative (depending on the system). Keep this up for a while and you will eventually get to a negative number.
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum Programming is a branch of mathematics. |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Javascript: Loop through ids | dirkfirst | JavaScript and CSS | 1 | 07-02-2007 03:28 PM |
| Sounds and Sound Loop Resources | TVDinner | Website Design | 0 | 03-10-2007 09:20 AM |
| Terminate a method..... | Ronin | Java Help | 1 | 02-08-2007 03:03 PM |
| Javaa:Tutorial - The Loop | John | Java Tutorials | 0 | 12-09-2006 11:01 AM |
| WingedPanther | ........ | 2753.6 |
| Xav | ........ | 2704 |
| Brandon W | ........ | 1702.32 |
| John | ........ | 1207.73 |
| marwex89 | ........ | 1175.24 |
| morefood2001 | ........ | 966.05 |
| dcs | ........ | 655.75 |
| Steve.L | ........ | 475.59 |
| orjan | ........ | 418.58 |
| Aereshaa | ........ | 383.54 |
Goal: 100,000 Posts
Complete: 98%