Read Mode
Default

Float Function ver.1.0 in Batch | By kvc

Hey Hello guys, We are again back with an awesome batch program (or Function) which may results into benefit for all of you batch programmers, and make your life easier. As we all know, but I want to tell it from my point of view, Whenever I Perform any mathematical operation in Cmd (Command prompt), I Would always wish that if I can perform these operation on float numbers also. (Float numbers or ...can also be called as Floating Point arithmetic operations in cmd)... but as cmd only supports integers, I thought that my This dream will never complete. But then, I came to know about thinking of making a function myself, so most of my calculations becomes accurate upto some decimal places.



e.g. if I want to divide 10/3 ... then cmd only gives output as "3"... but I want to get the original result... which is 3.3333333, but in cmd it seems impossible. But with little algorithm and trick, I've successfully defined the floating point values in cmd.


Simple and floating arithmetic operation
The image above shows difference between the cmd's usual arithmetic operation...and the arithmetic operation with float function... (with above image you can understand that you can't directly double click on float.bat file and run it...as it is a function...you have to call it from the batch file or cmd console as shown in the image above) and the image below this text shows the help message of float.bat function... you can see this msg by typing float /? in the cmd console...

Note that, the float function should be put in the same directory as your working directory or change the value of 'path' variable as following to use this function from any working directory... Just add following line to your Batch file for using this function from any working directory...

SET "Path=[Full Path of Float Function];%Path%"

Help Msg of Float point definition function
If you are still in any doubt, or face any flaw or bug related to the usage of this awesome batch function, you can simply leave a comment below, and we'll try to fix the bug or complete your requirement. As this is version 1.0 of the function, it will definitely contain some bugs, #TheBATeam will be very happy, if you'll report any of the new bugs you've found in this version of Batch Function. Please watch the following Embedded video for better understanding of the usage of this Batch function.


                 


Read about the algorithm by which I've performed this float value calculation in cmd...In the next post. we'll post a separate article on the algorithm that we've created and by that algorithm, this awesome Float function v.1.0 is Working. Download the function from the link given below. Please Do mention your responses in the comment field below, as we are also humans, and we also like social interaction. we'll be happy to know your reactions about our work, please do post your views. Thanks.


Keep learning, keep sharing…
Be happy, spread happiness…

Download Link : Floating value function.bat

#TheBATeam

2 comments:

  1. Replies
    1. Although I haven't used the Float Function, I think problem would be due to your code. I recommend using Float Function 1.1 as it fixes some of the present in this version.

      PaperTronics,
      TheBATeam

      Delete

Powered by Blogger.