float

IE7 body width increases with floated element

In IE7 standards mode rendering, a strange thing happens with the following body: <body> <div style="border: 1px solid black;"> <span style="float: right; font-style: italic;">some text to the right</span> other text to the left </div> </body> The body width doubles, even though the <div> width looks correct. There is just...

Is it possible to prevent wrapping of child elements in HTML?

.container { position: absolute; bottom: 0px; height: 25px; left: 200px; padding-right: 5px; background-color: black; overflow: hidden; } .child { position: relative; float: left; height: 100%; width: 95px; background-color: #99CCFF; margin-left: 5px; } I when the size of the browser window is smaller than will allow for...

Python changes Integer in Float by itself

Hello, I'm trying to learn Python, (i have 2.5.4) by writing a snake game, but I'm stuck. Some integers change into floats and keep changing randomly, at least from my perspective :) The problem is that Snake.spawnPoint gets changed by Cam.move() print Snake.spawnPoint # first time, this returns '[25, 20]' ,which is good. Cam.Move() p...

In Python small floats tending to zero

Hey! I couldn't find an answer to this problem so I'm asking it here: I have a Bayesian Classifier programmed in Python, the problem is that when I multiply the features probabilities I get VERY small float values like 2.5e-320 or something like that, and suddenly it turns into 0.0. The 0.0 is obviously of no use to me since I must find...

HTML/CSS: Expanding a float-left element to remaining width of parent

For the life of me I can't figure this out. I have a container div with a specific width. And a few children div inside it. I want the last div to expand its width to fill in the remaining width left in the container. How can I do this? Here's an example (also at http://jsfiddle.net/nbKAr/): <div id="container"> <div>a</div> <d...

CSS Select Images with style="float:left" possible?

Hello! Similar to selecting img[title="test"] can I somehow select images that have a style property of float set to left? I want to set left and bottom margins for them which don't apply to right floating images. Thank you. ...

CSS/JS: Floating block elements of differing heights?

Here’s what I'm working with. As you can see, I’ve got a lot of block elements, that I want to get into five columns. However, since they’re of differing height, they don’t respond well to being floated. (Hence the huge hole in the middle of the page.) I know I’ve seen a JS workaround, that calculated the heights and put the elements...

Objective c - float returning wrong value

Hi I'm using objective c and trying to output a value from a function. Apparently I am doing something wrong because I'm receiving an incorrect value. This is my code: -(float) getAngleBetween { float num = 0.0; return num; } and I'm calling it as follows: float *theAngleBetween = [self getAngleBetween]; NSLog(@"Angle.. = %f", the...

Issue with NSNumber -initWithDouble and resulting values

Hi all, I'm using NSNumber to store various values, but sometimes run into issues when doing calculations with the values and initializing new NSNumber objects for the results. I've figured out how to overcome it, but I couldn't for the life of me explain why it works and since my grasp on numerical values in computer environments (doub...

why does the containing div not recognize the height of the items within?

how can my containing div (boxes_blue) recognize the height of the items within? #boxes_blue { display: block; margin: 0 0 0 175px; border: 1px solid brown; clear: both; } #boxes_blue_each { float: right; height: 100px; width: 100px; padding: 10px; border-left: 3px solid #fff; background-color: #004964; color: #fffacf; text-transfor...

DIV wont work with float objective c

Hi I'm trying to use: float divAm = (float)theAngle%(float)rads; but its saying that Invalid operands to binary % theAngle and rads are both of type float. Any suggestions please? Thanks ...

float java-me j2me

anyone know bigdecimal in j2me midp 2.0? actually i just want to make j2me app, which is able to compute 1 / 6. and print it as 0.1666667. just like embedded calculator in many(every) mobile phone. i use float it prints 0.0 i use double it still prints 0.0 many thanks. ...

System.Convert.ToSingle() Problems, (1.5) vs (1,5)

I'm writing program in C# for converting between model formats. The model format has numbers as text such as "-0.136222". I can use System.Convert.ToSingle() to convert this to a floating point number. But here in Germany we use commas as decimal points (-0,136222), and System.Convert picks up on this. Now I have the problem of it not r...

Accumlation error revisit

Hello, I got another question which continues from this one http://stackoverflow.com/questions/3695178/accumulation-error I heard some good idea and tried to implement it to the program. That is that I could store the results in Integer type first and afterward convert it to a float type. But the problem is that I can produce the corr...

Transmission of float values over TCP/IP and data corruption

Hello all. I have an extremely strange bug. I have two applications that communicate over TCP/IP. Application A is the server, and application B is the client. Application A sends a bunch of float values to application B every 100 milliseconds. The bug is the following: sometimes some of the float values received by application B a...

IE8 Clear float issue

My situation looked just like the problem discussed here: http://stackoverflow.com/questions/2511304/clear-float-issue That is: "I have a page with the standard navigation bar on the left and the content area taking up the rest of the horizontal area to its side. … This works fine except when the content area itself has fl...

xcode defining variable problem

Hi there Can someone please explain to me why my variable called activity is 0 when defined as a float, but displays the correct value when defined as an int? I have another float which is used for pretty much the same thing but works perfectly! @implementation AppPrefsViewController float age; int activity; ... -(void) updateAValues...

How to get floats value without including exponential notation

Hello, In C#, is it possible to perform ToString on a float and get the value without using exponentials? For example, consider the following: float dummy; dummy = 0.000006F; Console.WriteLine(dummy.ToString()); This gives the output 6E-06 However, what I was is 0.000006 The closest I could find was using the "F" qualifier, ...

iPhone - Store float in SQLite thru CoreData

Hi everyone, I store a float number in my SQLite (through core data) like this: unit.conversion = [NSNumber numberWithFloat:0.001]; When I look at the SQLite database the value is 0.0010000000474974513 unit.conversion is an optional float in my datamodel... What's wrong with that? Thanks ...

GCC Handling Float comparison differently at different Optimization Levels

I have some simple code that is comparing two float values to illustrate a problem I see with GCC's optimization and am hoping someone can help me figure out why the output it produces is different under some repeatable circumstances. First, I know it's bad to compare float values with == because you can be off by some very small amou...