racronus
04-08-2002, 07:11 PM
I'm doing a trig function program. what is the actual value of this: -9.25596e+061 ?
| //flex table opened by JP
Click to See Complete Forum and Search --> : C++ question, number display racronus 04-08-2002, 07:11 PM I'm doing a trig function program. what is the actual value of this: -9.25596e+061 ? qball 04-08-2002, 11:04 PM er, aaa, er. That is the value. -9.25596e+061 It's scientific notation. http://www.ugrad.math.ubc.ca/coursedoc/math100/notes/derivative/exp2.html So basically: -9.26 times 'e' raised to the 61st power. racronus 04-09-2002, 09:38 PM thanks for the reply, that was guess but the +0 threw me off. I guess it meant possitive, still not sure why the 0 is there, maybe the programing software? qball 04-09-2002, 11:25 PM "+061", "+61", whatever... seems the same to me, mathematically (sp?). The '0' may imply a level of precision greater than no '0'... Rhino302 04-10-2002, 12:08 AM What data type are you using for that number? gfunkmartin 04-10-2002, 09:18 AM -9.26 times 'e' raised to the 61st power. qball, I am going to have to gainsay your knowledge here. I believe that the value is actually -9.26... x 10 ^ 61 (instead of e^61). It's easy to see where the mistake was made, but scientific notation is k * 10^n, where 1 <= k < 10. The e is just a shorthand for scientific notation. Jason Rhino - Here's the possible data types for the number: [unsigned] [long] float [unsigned] [long] double qball 04-10-2002, 05:48 PM The e is just a shorthand for scientific notation. Actually, you may be true, but it would be a typo, methinks, as: 'E' is shorthand for scientific notation. http://java.sun.com/j2se/1.4/docs/api/java/text/DecimalFormat.html http://www.nyu.edu/pages/mathmol/textbook/scinot.html Seeing it is a trig function, 'e, the natural log' could be valid and shouldn't be discounted without further info... gfunkmartin 04-11-2002, 12:18 AM It may be a trig function, but remember that we're still dealing with C++ here. And unless I misread the post, all that racronus did was output the value, probably something like: float some_value; cout << some_value; If some_value was a small number, it probably would be output in scientific notation. And I've seen scientific notation using both the capital E and the lower-case e Jason qball 04-12-2002, 12:47 AM without further info... would be helpful. dealing with C++ here Maybe, but, dealing with notation. Language independent. I've seen scientific notation using both the capital E and the lower-case e So have I. Show me a trig function, using 'e', with output in 'e' units I've seen people drive slow in the fast lanes... gfunkmartin 04-12-2002, 08:44 AM I've seen people drive slow in the fast lanes... I hate it when that happens lol :) gfunkmartin 04-12-2002, 08:49 AM qball, I just took the time to compile and run a very short program. Here's the source I used: #include <iostream> int main() { float x = 10000000000000; cout << "x = " << x << endl; return 0; } And here's the output: $ ./a.out x = 1e+13 Jason SysOpt.com
Copyright Internet.com Inc. All Rights Reserved. |