Home > Back-end >  A question about floating point arithmetic
A question about floating point arithmetic

Time:09-29

Is in use BCB6 UpDown control to add and subtract the number of RichEdit control, add and subtract, for example, you get 65 after I use RichEdit2 - & gt; Lines - & gt; Strings [I]/10; This statement was 6, I want to get 6.5, that is to say, get the decimal will be calculated by dividing the number of ten, but now it seems is the result of the integer divided by 10, could you tell me what to use operators, such as RichEdit control number is 65, I'd like to get 6.5 after divided by 10, what should I do??

CodePudding user response:

 double val=this - & gt; RichEdit1 - & gt; Lines - & gt; Strings [I] ToDouble ()/10; 

CodePudding user response:

Pay attention to your data types to float
  • Related