Unix Technical Forum

Question On Floating Point In Gcc For Solaris Sparc

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 ...


Go Back   Unix Technical Forum > Unix Operating Systems > Solaris Operating System > Sun Solaris Administration

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-16-2008, 10:34 AM
Thomas Dineen
 
Posts: n/a
Default Question On Floating Point In Gcc For Solaris Sparc

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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 01-16-2008, 10:34 AM
Dave (from the UK)
 
Posts: n/a
Default Re: Question On Floating Point In Gcc For Solaris Sparc

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 01-16-2008, 10:34 AM
Paul Floyd
 
Posts: n/a
Default Re: Question On Floating Point In Gcc For Solaris Sparc

["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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 10:17 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com