Go to Post I think he GDC is just rick-rolling all of us. - z_beeblebrox [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Spotlight this post!  
Unread 05-02-2005, 15:10
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,810
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: Cannot access "double" values

I can use
double f=9.9;
without any trouble.

This Microchip implementation of printf doesn't support the printing of floats, but you can easily print them on
your own.

Code:
#define ACCURACY 1000 //How many decimal places are important to you
 
void PrintFloat(float value)
{
	long i, i2; // Don't need to be longs if you only need a few significant digits
 
	/* Separate the whole number from the fraction and print each of them */
 
	i = (long) value;
	i2 = (long) ((value-i)*ACCURACY); // You can get fancy and round by adding .5
 
	printf(" %d.%03d \r", (int)i, (int)i2); //e.g., "234.078"
}
(Been there, did this a few days ago on http://www.chiefdelphi.com/forums/sh...489#post328489)
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 05-02-2005 at 22:21. Reason: Loose use of the term "printf" caused confusion
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Acceleration Sensor Connected, but values are odd.... Leav Electrical 7 04-02-2005 15:28
trentonDrive.c: our joystick/wheel drive code gnormhurst Programming 16 03-02-2005 14:40
Good book to learn MS Access from? Elgin Clock Math and Science 2 05-10-2004 20:20
A testimony to my unique FIRST experience: Ken Leung General Forum 22 14-04-2004 20:45
Access Database help... kacz100 Scouting 12 18-03-2004 19:18


All times are GMT -5. The time now is 00:03.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi