dexterslab - 4 days ago 6

Vb.net Question

I have a C++ program , a line from it in macro definitions says

`#define U_MIN 1.0e-5`

#define U_MAX 1.0e5

If I wish to convert this code in Vb.net language what is the equivalent?

Answer

`e`

is exponent notation...

```
1.0e-5 = 1.0 x 10 ^ -5 = 0.00001
1.0e5 = 1.0 x 10 ^ 5 = 100000
```

so..

```
Const U_MIN As Double = 0.00001
Const U_MAX As Double = 100000
```

Note that Visual Studio actually lets you use exponent notation, so you can type

```
Const U_MIN As Double = 1e-5
```

and it will expand it for you..

Source (Stackoverflow)

Comments