Sponsored By

Sign in to follow this  
iccaros

Help With C++

Recommended Posts

we are converting over c++ classes to c# at work (why ..well lets say that code that works in VS 2003 c++ dose not work in VS 2005 and we have no stong C++ programmers to fix the issues)

I have some thing like this

1.e-20

is e an exponet? and if so could change this to

1.0^-20 ?

for c#

Share this post


Link to post
Share on other sites

never mind

Math.POW(1.0,-20)

is the anwer

Share this post


Link to post
Share on other sites

"1.0e-20" or "1e-20" should work. (I don't have the C# spec handy but mcs accepts both.)

Edited by jcl

Share this post


Link to post
Share on other sites
"1.0e-20" or "1e-20" should work. (I don't have the C# spec handy but mcs accepts both.)

thanks, it was throwing strange errors before, so I did it the VB way, but it does work like this

void test()
{
double x =5;
double b = x * 2e-20;
}

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this