This is a discussion on Question On Floating Point In Gcc For Solaris Sparc within the Sun Solaris Administration forums, part of the Solaris Operating System category; --> Gentle people: A question: in Gcc for Solaris Sparc is there any initialization required previous to the execution of ...
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Gentle people: A question: in Gcc for Solaris Sparc is there any initialization required previous to the execution of Floating Point Instructions in a program? Inspection of the _start function implies that there is! Can anybody explain the details? Thanks for the help. Thomas Dineen |
| |||
| Thomas Dineen wrote: > Gentle people: > > A question: in Gcc for Solaris Sparc is there any initialization > required previous to the execution of Floating Point Instructions > in a program? > > Inspection of the _start function implies that there is! Can anybody > explain the details? > > Thanks for the help. > Thomas Dineen > What do you mean by 'initialization'? Here's a program that does a bit of floating point maths. Nothing more/less than one would have in any other C program. I must be missing the point somewhere. sparrow /export/home/drkirkby % cat test.c #include <stdio.h> #include <math.h> main() { printf("The sine of 45 degrees is %lf\n",sin(45*M_PI/180)); } sparrow /export/home/drkirkby % gcc -lm test.c sparrow /export/home/drkirkby % ./a.out The sine of 45 degrees is 0.707107 -- Dave (from the UK) Please note my email address changes periodically to avoid spam. It is always of the form: month-year@althorne.org Hitting reply will work for a few months only - later set it manually. http://chessdb.sourceforge.net/ - a Free open-source Chess Database |
| ||||
| ["Followup-To:" header set to comp.unix.solaris.] On Tue, 25 Sep 2007 11:13:57 -0700, Thomas Dineen <tjjdineen@comcast.net> wrote: > Gentle people: > > A question: in Gcc for Solaris Sparc is there any initialization > required previous to the execution of Floating Point Instructions > in a program? > > Inspection of the _start function implies that there is! Can anybody > explain the details? Much depends on which "instructions" you are going to be using. I'm not sure where your "_start" function comes from. Please explain further. In general, I wouldn't be surprised if mathematical libraries (including libm) require some initialization. But that should be all taken care of under the covers. For everyday maths, you shouldn't need to do anything. A bientot Paul -- Paul Floyd http://paulf.free.fr |