float

inline-block on span

I expected the two span tags in the following sample to display next to each other, instead they display one below the other. If I set the width of the class span.right to 49% they display next to each other. I am not able to figure out why the right span is pushed down like the right span has some invisible padding/margin which makes it...

Can cout alter variables somehow?

So I have a function that looks something like this: float function(){ float x = SomeValue; return x / SomeOtherValue; } At some point, this function overflows and returns a really large negative value. To try and track down exactly where this was happening, I added a cout statement so that the function looked like this: flo...

float divs

I have a list with two <div>s in every <li> and I want to float them one next to the other and I want the <li> to take the whole availabe space. How do I do it? <html> <head> <title></title> <style type="text/css"> body { } ul { } li { } .a { } .b { } </style> </head> <body> <ul> <li> <div class="a"> content </div> <div class="b"> conte...

Would you consider float values to behave differently across a release and debug builds to be a bug?

My application is generating different floating point values when I compile it in release mode and in debug mode. The only reason that I found out is I save a binary trace log and the one from the release build is ever so slightly off from the debug build, it looks like the bottom two bits of the 32 bit float values are different about 1...

Best way to parse float?

What is the best way to parse a float in CSharp? I know about TryParse, but what I'm particularly wondering about is dots, commas etc. I'm having problems with my website. On my dev server, the ',' is for decimals, the '.' for separator. On the prod server though, it is the other way round. How can I best capture this? ...

Are doubles faster than floats in c#?

I'm writing an application which reads large arrays of floats and performs some simple operations with them. I'm using floats because I thought it'd be faster than doubles, but after doing some research I've found that there's some confusion about this topic. Can anyone elaborate on this? Thanks. ...

Strange float behaviour in IE7

I want to create a simple box with a header bar containing a title and some tool buttons. I have the following markup: <div style="float:left"> <div style="background-color:blue; padding: 1px; height: 20px;"> <div style="float: left; background-color:green;">title</div> <div style="float: right; background-color:yellow;">t...

Inserting a value into a SQL float column generates a weird result

I am working on a legacy ASP application. I am attempting to insert a value (40.33) into a field in SQL Server 2000 that happens to be a float type. Every place I can see (via some logging) in the application is sending 40.33 to the Stored Procedure. When I run SQL Profiler against the database while the call is happening, the value t...

Disappearing bullet points

http://biochrom.fivesite.co.uk/catalogue4.asp On the page above there is an image floated to the left. To the right of it is a list, titled "features". The list items have a background image, however, it isn't appearing. List 2 shows how the background image looks. Does anyone know how I can make the bullets visible? ...

CSS for container divs and falling to the next line

Hi, I'm more of a programmer than a designer, and I'm trying to embrace DIV's rather than using tables but am getting stuck. Here's what I'm trying to do. I am setting up a survey page. I want each question's text to sit at the top of the blue div, and wrap if it's too long. I want all of the red divs to line up at the top right cor...

Float Left 100% height div - gap between divs

Mark Up <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="test.aspx.cs" Inherits="Zuhaib.test" %> <!-- Put IE into quirks mode --> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt; <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head runat="server"> ...

Php precision with floating point - complex equation = 1

I have the following equation 1 - ((.5 * 0.83333333333333) ^ 2 + (.5 * 0.83333333333333) ^ 2 + (.5 * (1 - 0.83333333333333)) ^ 2 + (.5 * (1 - 0.83333333333333)) ^ 2) In Php5, this results in an answer of 1 as opposed to .63 (on two machines, OSx and Centos). Should I be exclusively using the bc math functions of Php to do equations l...

How do I convert a float to an int in Objective C?

Total newbie question but this is driving me mad! I try myInt = [myFloat integerValue]; and I get an error saying essentially integerValue doesn't work on floats. How do I do it? ...

Good open source JavaScript math library for floating point operations?

Can any one recommend a good JavaScript library to solve floating point problems in JavaScript? ...

How can I convert a string to a number in Perl?

How would I convert a string holding a number into an integer in Perl? ...

Firefox CSS: Given 2 divs, how can I float the *second* one to the right using static positioning?

I'm working on a Youtube userstyle script that displays comments side by side with the video so you can watch the video and read the comments at the same time (what a marvelous idea - duh). You can see in the screenshots how far I've got. That means I only care about Firefox, and that CSS3 goes. The problem I have is that I want to make...

How to embed a swf on top of a html page?

Hi, I want to embed a swf over a html page, like a floating video watching panel. I already have a swf file which will automatically adjust its size according to the browser size, and the swf file is partially transparent. I thought I can just add a div tag, make the position absolute and change z-index bigger, but that doesn't work be...

Float a div right, without impacting on design.

Hi, I want to float a div to the right at the top of my page. It contains a 50px square image, but currently it impacts on the layout of the top 50px on the page. Currently its: <div style="float: right;"> ... </div> I tried z-index as I thought that would be the answer, but I couldn't get it going. I know it's something simple ...

Error CASTing value to FLOAT in SQL Server 2005

I'm trying to get a stored procedure to work for a co-worker who is out sick (and thus can't be asked for guidance). I have a SQL Server 2005 database that has this exact procedure, and I'm trying to make the scripts to convert a test database to match this dev database. My script has several lines like: CAST(RELATIVE_ERROR_RATIO AS F...

How to make floating divs fill up space

Hi, I'm trying to create a "workflow" bar on a web page. The items in the workflow might be of different lengths. There might be enough items to fill the width of the screen, hence the flow needs to wrap onto the next line. I'm using left floating divs to do this. However, I'd like the divs to take an appropriate amount of screen w...