Negative Float Into Positive

This is a discussion on Negative Float Into Positive within the C Programming forums, part of the General Programming Boards category; I have an enquiry, I have a float datatype that may or may not have a negative value assigned. Should ...

  1. #1
    Registered User
    Join Date
    Feb 2008
    Posts
    36

    Negative Float Into Positive

    I have an enquiry, I have a float datatype that may or may not have a negative value assigned. Should the value within the float has a minus sign before the numeric value, can I remove that minus sign and if so how...

    I'm a little unsure whether I need to declare new signed data types since with my program should the value is negative then I can simply switch the direction in terms of longitude and latitudes.

    -24.352745'E for example can be printed 24.352745'W without the minus sign. Can a float be printed losing the minus sign?

  2. #2
    Registered User
    Join Date
    Feb 2008
    Posts
    36
    sorted, I found the fabs function within the maths.h, I'm beginning to take a liking to my venture into C

  3. #3
    uint64_t...think positive xuftugulus's Avatar
    Join Date
    Feb 2008
    Location
    Pacem
    Posts
    355
    Quote Originally Posted by Cero.Uno View Post
    sorted, I found the fabs function within the maths.h, I'm beginning to take a liking to my venture into C
    May it be long and prosperous. Learn to read header files and you shall have a good journey.
    Code:
    ...
        goto johny_walker_red_label;
    johny_walker_blue_label: exit(-149$);
    johny_walker_red_label : exit( -22$);
    A typical example of ...cheap programming practices.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 2
    Last Post: 05-13-2009, 03:25 PM
  2. Could somebody please help me with this C program
    By brett73 in forum C Programming
    Replies: 6
    Last Post: 11-25-2004, 01:19 AM
  3. Half-life SDK, where are the constants?
    By bennyandthejets in forum Game Programming
    Replies: 29
    Last Post: 08-25-2003, 11:58 AM
  4. how to handle integer overflow in C
    By kate1234 in forum C Programming
    Replies: 8
    Last Post: 04-23-2003, 12:20 PM
  5. How do you search & sort an array?
    By sketchit in forum C Programming
    Replies: 30
    Last Post: 11-03-2001, 04:26 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21