Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > A bit of math logic please

Reply
Thread Tools

A bit of math logic please

 
 
catherine@myoddjobs.info
Guest
Posts: n/a
 
      07-06-2007
Hi, basically I need a function which will return a number for...

Given a number n (Say 800px) by what factor do I need to shrink it to
get it as close to but not over 300px?

Bear in mind that the number n may be 301px or 1638px

Thanks for any help!
Kate

 
Reply With Quote
 
 
 
 
=?ISO-8859-1?Q?G=F6ran_Andersson?=
Guest
Posts: n/a
 
      07-06-2007
wrote:
> Hi, basically I need a function which will return a number for...
>
> Given a number n (Say 800px) by what factor do I need to shrink it to
> get it as close to but not over 300px?
>
> Bear in mind that the number n may be 301px or 1638px


That's not a number. Lets work with numbers.

The factor is simply 300/n.

300/800 = 0.375

800 * 0.375 = 300

--
Göran Andersson
_____
http://www.guffa.com
 
Reply With Quote
 
 
 
 
catherine@myoddjobs.info
Guest
Posts: n/a
 
      07-06-2007
On Jul 6, 7:54 pm, Göran Andersson <g...@guffa.com> wrote:
> cather...@myoddjobs.info wrote:
> > Hi, basically I need a function which will return a number for...

>
> > Given a number n (Say 800px) by what factor do I need to shrink it to
> > get it as close to but not over 300px?

>
> > Bear in mind that the number n may be 301px or 1638px

>
> That's not a number. Lets work with numbers.
>
> The factor is simply 300/n.
>
> 300/800 = 0.375
>
> 800 * 0.375 = 300
>
> --
> Göran Andersson
> _____http://www.guffa.com


Thank you!

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
What is the point of having 16 bit colour if a computer monitor can only display 8 bit colour? How do you edit 16 bit colour when you can only see 8 bit? Scotius Digital Photography 6 07-13-2010 03:33 AM
Math.random() and Math.round(Math.random()) and Math.floor(Math.random()*2) VK Javascript 15 05-02-2010 03:43 PM
Asynchronous Logic Gates and Analog Logic Gates Jyoti Ballabh Software 3 11-26-2009 06:48 PM
64 bit - Windows Liberty 64bit, Windows Limited Edition 64 Bit, Microsoft SQL Server 2000 Developer Edition 64 Bit, IBM DB2 64 bit - new ! vvcd Computer Support 0 09-17-2004 08:15 PM
64 bit - Windows Liberty 64bit, Windows Limited Edition 64 Bit,Microsoft SQL Server 2000 Developer Edition 64 Bit, IBM DB2 64 bit - new! Ionizer Computer Support 1 01-01-2004 07:27 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57