# Simple Mathematics

**URL:** <https://fortran-lang.discourse.group/t/simple-mathematics/2815>\
**Category:** Help\
**Created:** [February 17, 2022, 8:09pm UTC](https://fortran-lang.discourse.group/t/simple-mathematics/2815 "2022-02-17T20:09:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ouzen](https://avatars.discourse-cdn.com/v4/letter/o/e9bcb4/32.png) [@Ouzen](https://fortran-lang.discourse.group/u/Ouzen)\
**Post date:** [February 17, 2022, 8:09pm UTC](https://fortran-lang.discourse.group/t/simple-mathematics/2815/1 "2022-02-17T20:09:39Z")

</div>

I have a problem with dividing 1/10, i set the value as real number , here is the code

```auto
program test1
implicit none

real :: ne,mn,dt,pw

mn=1.0e0!multiplied number
dt=1.0e0
ne=10.0e0
pw=-1

dt=1/10
print *, dt

end program test1

```

also when i try to do 10\*exp(pw), where pw is -1 i dont get 0.1

---

<div class="post-metadata">

**Author:** ![Beliavsky](https://avatars.discourse-cdn.com/v4/letter/b/ba8739/32.png) [@Beliavsky](https://fortran-lang.discourse.group/u/Beliavsky)\
**Post date:** [February 17, 2022, 8:15pm UTC](https://fortran-lang.discourse.group/t/simple-mathematics/2815/2 "2022-02-17T20:15:37Z")

</div>

Integer division (both numerator and denominator integers) in Fortran truncates, so

`print*,1/10`

gives 0.

You could write instead

`dt = 1/10.0`

---

<div class="post-metadata">

**Author:** ![msz59](https://avatars.discourse-cdn.com/v4/letter/m/3d9bf3/32.png) [@msz59](https://fortran-lang.discourse.group/u/msz59)\
**Post date:** [February 17, 2022, 8:34pm UTC](https://fortran-lang.discourse.group/t/simple-mathematics/2815/3 "2022-02-17T20:34:58Z")

</div>

> [@Ouzen](#):
>
> also when i try to do 10\*exp(pw), where pw is -1 i dont get 0.1

10\*exp(pw) does not mean 10 to the `pw` power but 10 times (`e` to the `pw` power), where `e` is the Euler’s constant (2.718281…). To raise 10 to some power, use `10**pw`
