Double (or float) division does not work
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-12-16 1:14 AM
Hi,
on STM32H7 I want to divide 25600/1000 - I get always result = 25. Why? What I do wrong?
double freq;
int odr=25600;
freq = (double) (odr)/1000;
Thank you
Labels:
- Labels:
-
DEBUG
-
STM32H7 Series
11 REPLIES 11
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-12-18 5:31 PM
One last thing, refrain from using float and double under interrupt.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-12-20 2:57 PM
Though it's not an absolute rule. One just have to understand what he is doing and what are the consequences:

- « Previous
-
- 1
- 2
- Next »