B4A Question ATan2() Ceil() - Jim Brown (first post)    Feb 20, 2011 Thanks Erel
for ATan2D() I am using this at the moment (as used in my SnookerSim posted in user cre... Italian Convertire un numero Double in Float - emexes (first post)    Jan 10, 2025 se devo arrotondare il numero per eccesso? es: 4.6 a 5 ? 160640 ma fate attenzione ai numeri negativi, potrebbero fare il contrario di ciò che vi aspettate: Log( "Ceil( 4.6) = " & Ceil( 4.6) ) Log( "Ceil(-4.6) = " & Ceil(-4.6) ) Waiting for debugger to connect... Program started. Ceil( 4.6) = 5 Ceil(-4.6) = -4... B4A Code Snippet [algorithm] Digital Low-Pass Filter - max123    Jan 26, 2024   (9 reactions) = Ceil((INPUT * COEF) + (FILTER * (MAXCOEF - COEF))) where: - INPUT is the current input signal... calculation. Note here that I used 'Ceil' function because it round a value to integer, without.... As I did on VB6 I don't had necessity to Ceil values but all variables are dimensioned as Currency... * 1000 FILTER = Ceil((INPUT * COEF) + (FILTER * (MAXCOEF - COEF))) OUTPUT = FILTER / 1000 '... this way: FILTER = Ceil(((INPUT * 1000) * COEF) + (FILTER * (MAXCOEF - COEF))) OUTPUT = FILTER... B4A Question Why i getting this Error - Brian Dean (first post)    Mar 23, 2024   (1 reaction) This code is not doing what you think it is doing; you are converting the argument to an integer before you even execute the statement ...
Sub Fix(arg As Int) As Int
Return Ceil(arg )
End Sub
You don't need to use it. Replace it everywhere as follows :
N = Ceil((I - 1) / 10631)
That might not be your only error, of course.... B4A Question rules of precedence - makeed0    Jul 10, 2024 What are the rules of precedence when dealing with built-in mathematical functions such as Sin, floor, and Ceil?... B4A Code Snippet [B4X] [BitmapCreator] Draw radial gradients - Erel    May 10, 2018   (8 reactions)   tags: circle fill gradient (i)) Next Dim MaxDistance As Int = Ceil(Sqrt(Power(Rect.Width / 2, 2) + Power(Rect.Height / 2, 2... LengthOfEachColor As Int = Ceil(MaxDistance / (GradColors.Length - 1)) Dim c As Int For i = 0 To MaxDistance... Share My Creation Number to e notation - knutf    Apr 9, 2025   (3 reactions) ,DecPlaces, False) Else If Value < 1 Then e = Ceil(Logarithm(1/Value,10)) res... B4J Question Wrap Text without Breaking the Words - xulihang (first post)    May 6, 2024   (1 reaction) I think there is a workaround. I can measure the longest word's length and make it as the minimum width for the TextFlow. Dim c As B4XCanvas c.Initialize(MainForm.RootPane) Dim minWidth As Int = Ceil(c.MeasureText("together ",fx.DefaultFont(15)).Width) ... B4A Question move camera position x y change - kimstudio (first post)    Jul 14, 2023 Motion estimation could help.
I tested your code and found that if we change sumx, y and N to int type and remove ceil funtion it can speed up, stange.... B4J Question How to do division of two Ints as integer division instead of floating point division? - kimstudio (first post)    Jan 6, 2024   (2 reactions)
Whereas the Double to Int cast usually involves rounding, which can bite if the rounding method you're expecting is different to what's happening.
It is (int) so get integer towards zero other than floor(), ceil(), and round().
C/C++ cases:
149356... Page: 1   2   3   4   5   6   7   |