77 Topics
|
|
Stuck again, still, im learning from my large list of mistakes, haha so this time im trying to convert a decimal to hexadecimal, i tried using hex(number) but its not suitable for the situation as this returns a string. and i dont know how or if i can convert a … |
|
I'm writing a program to convert Decimal numbers to binary, hexadecimal, and BCD as a refresher before i start getting code assignments in school. I'm almost done, but i have a seg_fault (compiler says decToHex function) in 1 function and i am hoping for some feedback on the others. I'll … |
|
I have a problem when adding 2 numbers in assembly because we are using hex. When add 4+5 (34h + 35h) the output is 9 but if I add 5+5 (35h + 35h) the output displays colon(:) or 3ah instead of 10. Here's the sample image when i generate the … |
|
Hey guys, it's been a while since i've had to do any assembly programming but it's come up again in a course of mine to haunt me :p We're trying to simulate reverse polish notation, which is fairly simple..and all we have to implement is addition/subtraction, with a few other … |
|
So my problem is writing a program that asks the user to input a number wich is stored with scanf then print the binary representation of that number in 32 bits, as in if the number is 1 i would need 31 0's and a 1. [CODE]#include <stdio.h> void dec_bin(long … |
|
Hi. I need a function which will convert a decimal to a fraction, so that I can put in [CODE]echo dec2frac(1.75);[/CODE] and it'll output 1 3/4. Any suggestions? Thanks |
|
Greetings. Ok so my problem is that I get a "Currency" formatted value from the database and this value sometimes comes as a whole number (without decimals) and sometimes it doesn't. But, when I output the information as "string" into an XML File, I [B][I]always need to show the 2 … |
|
Hey im new in this forum but really need help with making program on assembly 8086 that will take a string of 4 characters , then check if they are right and after that convert them to binary and decimal, then again hexadecimal, and in the end print something like … |
|
I think its more than a year that I ask my questions about programming in this forum.Looks like its the time that I help a little too. So I wanna put my best here.I hope it'll help some one. Still I'll appreciate any suggestion. Another point,It was my first time … |
|
Ok so i want to make a program that calculates pi. Ive done that already but it only gives me so many decimal places. I want it to give me tons. Im using Dev C++ if that helps too. Here's my code: [CODE] #include <iostream.h> #include <math.h> int main() { … |
|
Hi Everyone, I have a requirement of formatting the text inside the input text box. On page load, the textbox value by default get set to say 10.0 or 15.0. What I want is just integer and remove the decimal point and the values ahead. Thanks in Advance. Regards JJ |
|
I have a problem that I am having trouble solving. I have a string of undefined length containing '0' or '1'. I need to convert this string to decimal... but I CANNOT store it in anything but another string. My issue is how to do this?! I have been thinking … |
|
Hello all I'm having a few issues with a Python program in that I am performing decimal calculations on and most values come up as desired, however every so often, when there is a very small decimal, the number is represented like "6.80E-7" rather than the desired "0.000000680". Here's a … |
|
Hey guys I am currently writing a code that will take the user input of a number and convert it to its hexadecimal form with the use of Stack ADT. This is what I have so far and would appreciate any help. [CODE]#include <stdio.h> #include <stdlib.h> #include <stdbool.h> #include "stack.h" … |
|
Im trying to make a fast food program on which the user will input the amount that he has, then he will click on what he wants, by using check boxes. There are 7 different check boxes with 7 different amounts of money. I got an idea on what to … |
|
i have a simple question: I want to define a hex character array in C, but I don't want to have to define the elements one at a time. my programme needs an hexadecimal array as input of 128 bits. for example, [code=c]unsigned char temp2[32]= {0x00 ,0x11 ,0x22 ,0x33 ,0x44 … |
|
The problem for my CMPT103 class is to write a program that takes a binary number as an integer and returns it as a decimal, i would be able to do this easily by taking it as a charecter array and dealing with each individual element but i dont understand … |
|
hi all.. i want to convert decimal to binary.. best regards..thanks. |
|
I am to write a program that converts either binary, hex or octal to decimal. We are to use methods for the first time (Not a problem). I have written almost all of the code but the conversion. We can't use int.toDecimal or any shortcut. All must be long coded … |
|
Im trying to make a tax and tip calculator and whenever the tax comes up it goes 10 or more decimal places and im trying to restrict it to two. [code=java] public static void main(String[] args) { double cost, total, tip, taxtotal, tiptotal, subtotal, grandtotal; Scanner myScanner = new Scanner(System.in); … |
|
[CODE]int main() { static short multiplycounter; static short dividecounter; double decimal; int rdecimal; cin >> decimal; rdecimal = int(decimal); cout << setprecision(10) << decimal << endl << rdecimal << endl; if(rdecimal % 1 != 0) { while(rdecimal % 1 != 0) { if(rdecimal % 1 == 0) { break; } … |
|
Dear All , I have a binary file , the defincition of its content is as below L Here is one of my 'log items' from the data.bin, all data is stored in little endian (ie. least significant byte first) 11 63 39 46 --- Time, UTC in seconds since … |
|
Dear All , I have a device with upon serial communication , it send the data as HEX values , (eg, C020042ABD0F91A103E400F929EBC) . I use the following code to get data from the serial port. [code] Dim fStream As New FileStream(sFileName, FileMode.CreateNew) ' creates new file Dim bw As New … |
|
Hi Daniweb! I couldnt find my problem anywhere else on this forum, so I decided to make my own thread... My problem: I'm trying to make a function to decide how many decimals a 'double' has. My code (slightly edited, here's the base of it): [CODE] // int m = … |
|
I cannot seem to correct the remaining errors in the code. This is the header [CODE]#ifndef DECIMAL_H #define DECIMAL_H #include <iostream> using std::ostream; using std::istream; // class Decimal definition class Decimal { public: friend istream operator>>( istream &, Decimal & ); Decimal( double = 0.0 ); void setInteger( double ); … |
|
Hi, I have a following problem. I have a number in string, for example "123456" and I'd like to convert it to int. This would not be a problem if I knew that the input number will always fit into an 32 bit integer. So if it won't I should … |
|
Hi, I am getting this error for my codes: Exception in thread "main" java.lang.NumberFormatException: For input string: "{ 1.0, 2.0, 3.0, 4.0, 5.0, 1.0, 2.0, 3.0, 4.0, 5.0, 1.0, 2.0, 3.0, 4.0, 5.0, 1.0, 2.0, 3.0, 4.0, 5.0, 1.0, 2.0, 3.0, 4.0, 5.0, 1.0, 2.0, 3.0, 4.0, 5.0}," at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:1224) … |
|
Hi, I want to know to rows and columns of numbers from a text file. I do not want to read it as a string, but one number (including numbers with decimal) by itself. I tried using FileInputStream and DataInputStream, but I'm not really good at it. I don't know … |
|
May I know how to solve floating decimal problems? |
|
hello there I was wondering how would we print numbers like xxxxxxxx.xxxx using cout? I know we can use setprecision() to get the decimals right to the dot. But i am looking to print the numbers left to the dot.ex: 00000012.12345 is there a way that i am unaware about … |
The End.