Rounded at most about base 2 "set decimal number."

If I get the decimal number 121, I want to turn that to 128. If 513, I want to round up to 512. If given 48, I would round which is for 32 or 64 (I fear particularly that!).

The key is for all decimal entry, I want to limit the return to the 1,2,4,8,16,32,64,128,256,512 and so on '2 powers of base' (i.e., 2 ^ n)

The ROUND function does not, at least as much as I know. Are there any other built-in function to do? Or a single SQL statement that allows to get the same?

A basic idea...

select power(2, round(log(2, :x)) ) from dual

Tags: Database

Similar Questions

  • How to set decimal digits

    Hi all

    Cascading QML if I calculate A / B and the result 3.45656566

    How I round off the number to 3.46

    I can not find any function to round or rnd.

    Thanks for your advice.

    you need to multiply, and divide to get a decimal number, if you want to go 3 places for the years 1000 and so on

    Math.round(num * 100) / 100
    
  • Result of the calculation were separated to the whole and decimal, number not rounding correctly

    I have 2 fields as a result of sharing: the whole and decimal number (1 decimal place). I Math.floor the result to get the whole number and everything is fine until I hit a case where the result is 92,97.

    This should give "93" in the whole of the field and '0' in the decimal field, instead it gives me '92' and '10' (even though I'm only hosting 1 character in the field).

    How can I get the '93' and '0' in the following code?

    fieldLVEDV = this.getField("LVEDV").value;

    fieldBSA = this.getField("BSA").value;

    If (fieldLVEDV! = "" & & fieldBSA! = "") {}

    totalLVEDV = this.getField("LVEDV").value + ((this.getField("LVEDVDec").value)/10);

    calculation = (totalLVEDV / fieldBSA);

    calculationDecimal = calculation;

    partWhole = Math.floor (calculation);

    if(partWhole <0) {partWhole =' ' ;}}

    this.getField("Index").value = partWhole;

    this.getField("IndexDecimal").value = Math.round (10 *(calculationDecimal-partWhole));

    {If (this.getField("IndexDecimal").value = '10')

    {

    this.getField("Index").value = partWhole + 1;

    this.getField("IndexDecimal").value = "0".

    }}

    } else {}

    this.getField("Index").value = "";

    this.getField("IndexDecimal").value = "";

    }

    I thought I'd add the blue part would do the job, but obviously it did not work.

    Ah, your problem is that you do not use the correct comparison operator. To check if two values are equal, the operator is "==" not not "=". Using "=", you assign the value 10 to the field which you then pass in 0 a few lines down. Use 'is' and things should work correctly.

  • How to set the number of lines displayed in a classic report when running?

    Hello

    Our client has several hardware configuration standard customer and want to allow end-users to choose their 'view profile' at the time of the connection. This "display profile" would contain some predefined values for these configurations material and supposed to give various parameters that must set the number of lines displayed in a classic regional report.

    I tried to provide parameters on the report of the region, but he has refused to accept anything other than numeric values. Is it possible to do?

    Best regards, Tamas

    The link is about the closest correlate in the documentation to the description of the attribute Number of Rows (point) .

    Looks like you tried to write - in vain - a name string or change of item in the attribute Number of Rows . The attribute Number of Rows (point) is the one that can actually do. For a list of items in the application, click the icon of the flashlight next to her.

  • Displays the decimal number

    Dear All;

    I just want to get a decimal number (i.e. 2.5), I tried the mathematical functions, it has not solved the problem.
    Is there another function that returns a decimal numbers. ?


    Thank you;

    In the case where what you mean is you have found values in the path of 2.66666667, etc. and want to round down to 2.7, that can be performed as follows:

    var pH:Number=Math.round(140*(-ySlider/550)) / 10;

    Essentially, you multiply the value by 10, round, then divide by 10.

  • How to set the number of e-mail messages that are stored on my iPhone

    How to set the number of e-mail messages that are stored on my iPhone – so when I don't have a network connection I can see a 'large' number of messages in my Inbox etc.

    This is series is not defined in the world

    You must go to settings-> mail, contacts, and calendars and check the settings of your e-mail provider offers in this area

  • In Firefox you get 4 how changing the expiry of browser history. It was easy until there was a counter to set the number of days to keep a history? Lizzie

    In tools, under the protection of personal information, I was able to set the number of days during which the browser history... Very handy when you need to keep a record of sites visited. Now in Firefox4 I have "Remember history" option. How will I know how the newspaper story is saved for the moment?

    In Firefox 4 you can no longer set the number of days of historic preservation. The method used by Firefox to store history has changed, for more details on the changes, see http://blog.bonardo.net/2010/01/20/places-got-async-expiration

  • I can set the number of events in the calendar to display in the Page Notifications?

    I have many calendar events every day (15-25), but only the following event appears in my display of notifications.   Is it possible for me to set the number I see?  As perhaps the next 3 or 5?  And then they are updated as events will expire?  iPhone 6 s

    No, it isn't. There are other calendar applications, for example schedule 5 of Readdle, that display more complete information, but it does not include the events 'expired' or has a Setup for the number of events displayed in the Notifications. I don't know either, but you can always check the App store. But to be honest, I doubt you will find one that handles what you are looking for in the notifications. The sight of Notifications is not really designed for the complete management of the content of the app.

  • print the decimal number

    Hello

    I am trying to print the decimal number, but I've always had the decimal number (between-1 to 1) witout '0' or '-0 ".

    Var num:num = 0,235

    MsgBox (num)

    her impression: ".." 235.

    Thank you

    Hello OzShimon,

    It's weird, I just tried your code and get this result:

    I noticed that this behavior can be changed in the configuration "Regions and languages" of Windows. In Windows 7, it's this dialog box:

    If I change the settings of this dialog to any of the zeros, the result is the same as you have described.

    Can you check your Windows settings and confirm that yours looks the same as mine?

    Best regards

    Otmar

  • generate the signal of decimal number

    Hello

    I have a program that calculate the heart rate from the ECG signal. I want to show the beats per minute on a graph with 60 s of the plot of the story.

    Since the vi who calculate the heartbeat I get output the string with the number, only when the wave of the tip, then I convert it to a number and then I place the offset of a simulated DC signal.

    (In the table below the beats per minute are always 60 because I'm simulating a sinusoidal signal with 1 Hz).

    ------>

    It works fine, but I'd like to see not the summits but a continuous line from one point to another, such as interpolation.

    in this case, it would have been a horizontal line to 60 BPM.

    I thought to store the last value of the chain and keep it frozen until the next update of value.

    Do you have suggestions on how to do it?

    Concerning

    Not clear what you get in the form of numbers, seems that you get too many zeros, and you get a decimal number or another 'dynamic '? value?

    You pulse-rate information could be ~ 45 to > 180 values per minute!

    You display the exact story of a minute?  Maybe (keep the last ~ 300 values with timestamps and use an XY diagram) a graphic story can be configured to display

    wait... Here's one way:

    I fed a chart (with 256 points in history), with a waveform. the wfrm has only a single value in the array of values and a t0. The chart is configured to display the 60 sec.  Seems to work

    My simulation will display a min rate of ~ 45 BPM, but you can beat him

  • How to test if the rest is a decimal number or an integer?

    Hi guys!

    I want to check whether or not my rest of two integers is a decimal number. Also, if it is a decimal number, I wana it allows to do a thing and if its an integer, I want her to do something else. How can I do?

    Help, please!

    Thanks in advance.

    Craster.D wrote:

    The task is to divide two numbers X and Y and a LED lights up if the result/rest is a decimal number. It can be higher or lower than 1, is not serious. If it is not a whole number, the LED should light.

    Great looks that you know exactly what you want to do, which seems to be the problem?  You will find the functions you need in the digital, boolean and comparison scheme.

  • Convert a decimal number to a string

    I work with a gas mixer and I try to transmit data rates. The mixer takes only decimal values, for example, if you want to 2500 cc debit you must pass it 2500.0. I tried to use the function of decimal string number and do a type cast but I get an error every time machine. The only thing that works is by using a control of the chain and entering the value, but I would like to do it with a digital command. Someone at - it tips or advice?

    Note that you have provided only a sample size. In addition, 2500.0 isn't a decimal number, it is a floating point value.

    It is also not clear if how you talk to the machine. You said that you used a Type Cast. For what? How do you communicate with the machine?

  • I have an office jet 5610v hp all-in-one and need to set the number of rings on a less number HOW?

    How do you set the number of rings for an office jet 5610v hp?

    Go to your settings on the printer.

    1. go to Fax settings

    2 choose settings fax Basica

    3 choose the RINGS BEFORE ANSWER

  • Custom message for: must be a signed decimal number consists of zero, one or more digits

    Hello

    We have an InputBox mapped the attribute type EO BigDecimal. Whenever the user enters special characters other than digital Gets the error message below.

    < af:inputText id = "it2" value = "#{bindings." Number.inputValue}.

    autoSubmit = columns '10' immediate = "true" = "true".

    Binding = "#{pageFlowScope.ServicesBean.numberInputText}" >

    < / af:inputText >

    Error

    Part r2:0:it2: "/" must be a signed decimal number consisting of zero, one or more digits, which can be followed by a comma and the fraction.

    Tried to add the custom resource group error message as shown in below, but no use.

    javax.faces.converter.BigDecimalConverter.DECIMAL=Summary - BigDecimal conversion error
    javax.faces.converter.BigDecimalConverter.DECIMAL_detail=Detail - BigDecimal conversion error

    Is it possible to give the personalized message?

    JDev Studio Edition Version: 11.1.1.6.0

    Thank you

    Bhaskar Pola

    Following this article and the problem solved.

    Customize the validation error message in JSF 2.0

    Thank you

    Bhaskar Pola

  • Enter a decimal number

    I'm having a problem of construction of the line "input" to ensure that the user can enter an integer or decimal number in form-> table cell, but not all the other characters.

    When I use the type = "number" as below, the user can enter a decimal places but gets a warning 'only an integer' to submit.

    < td > < input type = "number" name = <? PHP echo "id_". $i? > id = "<?" PHP echo "id_". $i? ' > ' value = <? PHP echo number_format($bev_row[$i]['new_qty'],2)? > > < table >

    Thanks for any help.

    Tom

    The default step for an input number element value is 1. To allow decimal values to be entered into a numeric field, you can assign the step attribute to "any" or a decimal value.

Maybe you are looking for