Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
December 06, 2016, 09:09:16 09:09


Login with username, password and session length


Pages: [1]
Print
Author Topic: Converting float to longword  (Read 1808 times)
0 Members and 1 Guest are viewing this topic.
aldi
Newbie
*
 Muted
Offline Offline

Posts: 15

Thank You
-Given: 148
-Receive: 8


« on: September 26, 2010, 04:47:57 16:47 »

Hello...first, sorry for my bad english, i hope you are understand what i mean.
i`m doing some project with lots of float data type. now i need to convert the result of calculation(which is a float data type) to longword so i can use the DIV or MOD in mikrobasic PRO 3.80. anyone can help me?

MCU = PIC18F2550 @20MHz

best regards

Erio
Logged
robban
Senior Member
****
Offline Offline

Posts: 265

Thank You
-Given: 34
-Receive: 38


Warrior


WWW
« Reply #1 on: October 27, 2010, 04:28:38 16:28 »

Wat about round Yr. floating data to an Integer. Of corse it depends on the accuracy, You can always instruct the calculator to restrict no. of fraction(e.g. 2 or more depending on Yr. app).
I have microbasic PRO 3.80, so if You give me Yr. source code, Maybe I can truncate the relevant floating data without comromising to the code performance. Compare PI= 3.14 which is sufficient to mostapps.

I doubt that Yr. calculations will deterioate due to small diffencies
Logged

Code Warrior
Pages: [1]
Print
Jump to:  


DISCLAIMER
WE DONT HOST ANY ILLEGAL FILES ON THE SERVER
USE CONTACT US TO REPORT ILLEGAL FILES
ADMINISTRATORS CANNOT BE HELD RESPONSIBLE FOR USERS POSTS AND LINKS

... Copyright 2003-2999 Sonsivri.to ...
Powered by SMF 1.1.18 | SMF © 2006-2009, Simple Machines LLC | HarzeM Dilber MC