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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this