<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: problem in F data type in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-f-data-type/m-p/2839668#M665042</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ankita,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try declaring it as type quann and check.&lt;/P&gt;&lt;P&gt;Some additional info:-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Type F values range from &lt;EM&gt;/- 2.2250738585072014E-308 to 1.7976931348623157E&lt;/EM&gt;308, as well as the number 0, with an accuracy of at least 15 decimal places. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You cannot enter floating point numbers directly in your programs. Instead, you must use text literals that can be interpreted as floating point numbers. You may use the following formats: &lt;/P&gt;&lt;P&gt;Decimal numbers with or without sign, with or without decimal point. The form &amp;lt;mantissa&amp;gt; E&amp;lt;exponent&amp;gt;, where the mantissa is a decimal. The exponent may be specified either with or without sign. You may also use spaces before or after the number. Examples of text literals with "floating point numbers": &lt;/P&gt;&lt;P&gt;'1', '-12.34567', '-765E-04', '1234E5', '&lt;EM&gt;12E&lt;/EM&gt;34', '+12.3E-4', '1E160'. &lt;/P&gt;&lt;P&gt;Use floating point arithmetic if you need a very large value range or you are making decimal calculations, but be aware of the following features of floating point arithmetic. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Internally, the exponent and the mantissa of floating point numbers are stored separately, each in two parts. This can lead to unexpected results, despite the high degree of intrinsic accuracy. These occur mainly when performing conversions from and to type F. &lt;/P&gt;&lt;P&gt;For example, the number 1.5 can be represented exactly in this notation, since 1.5 = 1&lt;STRONG&gt;2&lt;/STRONG&gt;&lt;STRONG&gt;0 + 1&lt;/STRONG&gt;2**(-1), but the number 0.15 can only be represented approximately by the number 0,14999999999999999. If you round 0.15 up to 1 valid digit, the result is 0.1 rather than 0.2 as you would expect. On the other hand, the number 1.5E-12 is represented by the number 1.5000000000000001E-12, which would be rounded to 2E-12. &lt;/P&gt;&lt;P&gt;Another example which actually occurred is the calculation of 7.27% of 73050 to an accuracy of 2 decimal places. The intermediate result 5.3107349999999997E+03, since the correct result, 5310.735, cannot be represented exactly in two parts with 53 bits. (If the hardware cannot represent a real number exactly, it uses the next representable floating point number. After rounding, you therefore get 5310.73 rather than 5310.74 as you would expect. &lt;/P&gt;&lt;P&gt;The ABAP runtime system calculates commercially and not "numerically" like the underlying machine arithmetic. According to the rounding algorithm of the latter, the end digit 5 must always be rounded to the nearest even number (not the next largest number), i.e. from 2.5 to 2, 3.5 to 4. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You should also note that multiplication using powers of 10 (positive or negative), is not an exact operation. For example, although 100.5 can be represented exactly in two parts, after the operation &lt;/P&gt;&lt;P&gt;F = F / 100 * 100 &lt;/P&gt;&lt;P&gt;F has the value 100.49999999999999. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As well as rounding errors, the restricted number of decimal places for the mantissa can lead to the loss of trailing digits. For example, 1 - 1.0000000000000001 results in zero. &lt;/P&gt;&lt;P&gt;This means that you cannot rely on the last digits in floating point arithmetic. In particular, you should not usually test two floating point numbers for equality; instead, you should check whether the relative difference abs((a - b)/a) is less than a predefined limit, e.g. 10**(-7).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;K.Kiran.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 22 Sep 2007 10:25:07 GMT</pubDate>
    <dc:creator>kiran_k8</dc:creator>
    <dc:date>2007-09-22T10:25:07Z</dc:date>
    <item>
      <title>problem in F data type</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-f-data-type/m-p/2839665#M665039</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi experts...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using F data type and it gets value 5.50000000000E+10.&lt;/P&gt;&lt;P&gt;but I want value like 5.500.&lt;/P&gt;&lt;P&gt;I don't want to use P data type.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please Help me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 22 Sep 2007 10:07:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-f-data-type/m-p/2839665#M665039</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-22T10:07:43Z</dc:date>
    </item>
    <item>
      <title>Re: problem in F data type</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-f-data-type/m-p/2839666#M665040</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ankita,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are you getting such a kind of output in the REPORT or when downloaded to an excel?&lt;/P&gt;&lt;P&gt;K.Kiran.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 22 Sep 2007 10:10:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-f-data-type/m-p/2839666#M665040</guid>
      <dc:creator>kiran_k8</dc:creator>
      <dc:date>2007-09-22T10:10:27Z</dc:date>
    </item>
    <item>
      <title>Re: problem in F data type</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-f-data-type/m-p/2839667#M665041</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Its a  report.&lt;/P&gt;&lt;P&gt;and it is output value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; is it possible to get value like 5.50 from 5.50000000000000+10. in F data type?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 22 Sep 2007 10:13:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-f-data-type/m-p/2839667#M665041</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-22T10:13:26Z</dc:date>
    </item>
    <item>
      <title>Re: problem in F data type</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-f-data-type/m-p/2839668#M665042</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ankita,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try declaring it as type quann and check.&lt;/P&gt;&lt;P&gt;Some additional info:-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Type F values range from &lt;EM&gt;/- 2.2250738585072014E-308 to 1.7976931348623157E&lt;/EM&gt;308, as well as the number 0, with an accuracy of at least 15 decimal places. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You cannot enter floating point numbers directly in your programs. Instead, you must use text literals that can be interpreted as floating point numbers. You may use the following formats: &lt;/P&gt;&lt;P&gt;Decimal numbers with or without sign, with or without decimal point. The form &amp;lt;mantissa&amp;gt; E&amp;lt;exponent&amp;gt;, where the mantissa is a decimal. The exponent may be specified either with or without sign. You may also use spaces before or after the number. Examples of text literals with "floating point numbers": &lt;/P&gt;&lt;P&gt;'1', '-12.34567', '-765E-04', '1234E5', '&lt;EM&gt;12E&lt;/EM&gt;34', '+12.3E-4', '1E160'. &lt;/P&gt;&lt;P&gt;Use floating point arithmetic if you need a very large value range or you are making decimal calculations, but be aware of the following features of floating point arithmetic. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Internally, the exponent and the mantissa of floating point numbers are stored separately, each in two parts. This can lead to unexpected results, despite the high degree of intrinsic accuracy. These occur mainly when performing conversions from and to type F. &lt;/P&gt;&lt;P&gt;For example, the number 1.5 can be represented exactly in this notation, since 1.5 = 1&lt;STRONG&gt;2&lt;/STRONG&gt;&lt;STRONG&gt;0 + 1&lt;/STRONG&gt;2**(-1), but the number 0.15 can only be represented approximately by the number 0,14999999999999999. If you round 0.15 up to 1 valid digit, the result is 0.1 rather than 0.2 as you would expect. On the other hand, the number 1.5E-12 is represented by the number 1.5000000000000001E-12, which would be rounded to 2E-12. &lt;/P&gt;&lt;P&gt;Another example which actually occurred is the calculation of 7.27% of 73050 to an accuracy of 2 decimal places. The intermediate result 5.3107349999999997E+03, since the correct result, 5310.735, cannot be represented exactly in two parts with 53 bits. (If the hardware cannot represent a real number exactly, it uses the next representable floating point number. After rounding, you therefore get 5310.73 rather than 5310.74 as you would expect. &lt;/P&gt;&lt;P&gt;The ABAP runtime system calculates commercially and not "numerically" like the underlying machine arithmetic. According to the rounding algorithm of the latter, the end digit 5 must always be rounded to the nearest even number (not the next largest number), i.e. from 2.5 to 2, 3.5 to 4. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You should also note that multiplication using powers of 10 (positive or negative), is not an exact operation. For example, although 100.5 can be represented exactly in two parts, after the operation &lt;/P&gt;&lt;P&gt;F = F / 100 * 100 &lt;/P&gt;&lt;P&gt;F has the value 100.49999999999999. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As well as rounding errors, the restricted number of decimal places for the mantissa can lead to the loss of trailing digits. For example, 1 - 1.0000000000000001 results in zero. &lt;/P&gt;&lt;P&gt;This means that you cannot rely on the last digits in floating point arithmetic. In particular, you should not usually test two floating point numbers for equality; instead, you should check whether the relative difference abs((a - b)/a) is less than a predefined limit, e.g. 10**(-7).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;K.Kiran.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 22 Sep 2007 10:25:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-f-data-type/m-p/2839668#M665042</guid>
      <dc:creator>kiran_k8</dc:creator>
      <dc:date>2007-09-22T10:25:07Z</dc:date>
    </item>
    <item>
      <title>Re: problem in F data type</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-f-data-type/m-p/2839669#M665043</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Try this code...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data temp type f.&lt;/P&gt;&lt;P&gt;data char(50) type c.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;temp = '5.500'.&lt;/P&gt;&lt;P&gt;char = temp.&lt;/P&gt;&lt;P&gt;shift char left deleting leading space.&lt;/P&gt;&lt;P&gt;write : /  temp,&lt;/P&gt;&lt;P&gt;       /2(5) char.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Gagan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 22 Sep 2007 10:25:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-f-data-type/m-p/2839669#M665043</guid>
      <dc:creator>former_member194152</dc:creator>
      <dc:date>2007-09-22T10:25:55Z</dc:date>
    </item>
    <item>
      <title>Re: problem in F data type</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-f-data-type/m-p/2839670#M665044</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi ..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data temp type f.&lt;/P&gt;&lt;P&gt;data char(50) type c.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;temp = '5.500'.&lt;/P&gt;&lt;P&gt;char = temp.&lt;/P&gt;&lt;P&gt;shift char left deleting leading space.&lt;/P&gt;&lt;P&gt;write : / temp,&lt;/P&gt;&lt;P&gt;/2(5) char.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In above code if I am using value '0.055' for temp. then the output is different like 5.50.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what should i can do??&lt;/P&gt;&lt;P&gt;help me.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 22 Sep 2007 11:02:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-f-data-type/m-p/2839670#M665044</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-22T11:02:00Z</dc:date>
    </item>
    <item>
      <title>Re: problem in F data type</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-f-data-type/m-p/2839671#M665045</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am not clear why you are not directly assigning the f type variale to the p type variable ? By the way you can try the bellow code it may help you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data : vch(25),
       vno(15),
       vex(10),
*       expon type i,
       expon type p decimals 4,
       vfloat type f value  '5.50000000000E+05'.
.

vch = vfloat.
split vch at 'E' into vno vex.
clear vch.
expon =  10 ** ( vex ) .
vch = vno *  expon.
write : / 'Float value ' , vfloat.
write : / ' Number  ', vch.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;here the result is stored in vch which is a character field.&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;shiba dutta&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 22 Sep 2007 11:25:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-f-data-type/m-p/2839671#M665045</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-22T11:25:31Z</dc:date>
    </item>
    <item>
      <title>Re: problem in F data type</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-f-data-type/m-p/2839672#M665046</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi SHIBA...&lt;/P&gt;&lt;P&gt;In ur code if I m  vfloat type f value  '0.050000000000E+05'. useing then the output of this is like '50000'. why this is happen??&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 23 Sep 2007 04:14:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-f-data-type/m-p/2839672#M665046</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-23T04:14:09Z</dc:date>
    </item>
    <item>
      <title>Re: problem in F data type</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-f-data-type/m-p/2839673#M665047</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;Thank for reply but i got its answer myself.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;coding for it is like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : t type f value '0.005000E+03'.&lt;/P&gt;&lt;P&gt;data : a type p decimals 3.&lt;/P&gt;&lt;P&gt;data : a1.&lt;/P&gt;&lt;P&gt;t = t / 100.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;a = t.&lt;/P&gt;&lt;P&gt;write : / a .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;output is :  / 0.005&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 23 Sep 2007 07:03:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-f-data-type/m-p/2839673#M665047</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-23T07:03:03Z</dc:date>
    </item>
    <item>
      <title>Re: problem in F data type</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-f-data-type/m-p/2839674#M665048</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;sorry ankita i misunderstood your question ... My code will give you the exact value of the float type in decimals. But you want the value except exponent... then you can try this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : vch(25),&lt;/P&gt;&lt;P&gt;       vno(15),&lt;/P&gt;&lt;P&gt;       vex(10),&lt;/P&gt;&lt;P&gt;       vfloat type f value  '5.50000000000E+05',&lt;/P&gt;&lt;P&gt;       vfinal(8).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vch = vfloat.&lt;/P&gt;&lt;P&gt;split vch at 'E' into vno vex.&lt;/P&gt;&lt;P&gt;write : / vno. " or you can assign it to vfinal&lt;/P&gt;&lt;P&gt;vfinal = vno.&lt;/P&gt;&lt;P&gt;write : / vfinal.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and if your problem has solved then pls close the thread.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;shiba dutta&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Sep 2007 03:21:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-f-data-type/m-p/2839674#M665048</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-24T03:21:03Z</dc:date>
    </item>
  </channel>
</rss>

