Ho una funzione definita così:
#define CEIL(num,den) ( ((num)+(den)-1)/(den) )
e l'uso è questo;
int len;
len = CEIL(L, step);
la CEIL però difficilmente mi restituisce un numero intero anche se lo sono
num e den, come fa quindi len ad essere un int senza usare il casting?
Grazie
michele 1 1629
Sorry, wrong newsgroup....
michele
"Michele" <mi********@lib ero.togli_i_k.i t> ha scritto nel messaggio
news:c5******** **@newsread.alb acom.net... Ho una funzione definita così:
#define CEIL(num,den) ( ((num)+(den)-1)/(den) )
e l'uso è questo; int len; len = CEIL(L, step);
la CEIL però difficilmente mi restituisce un numero intero anche se lo
sono num e den, come fa quindi len ad essere un int senza usare il casting?
Grazie michele
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: ivan_oj28 |
last post by:
Hi, I am developing an application where I need to read the caller id
from an incoming call. The only info (for now) I need is the caller id
info, so that I can display the propper caller info on screen if so
desired.
I was thinking on using asterisk (asterisk.org) for this with
appropriate 2FXO/2FXS card but I do not know if this is just overkill
(asterisk for this). Do you know of any other solution/way of getting
the caller id and...
|
by: Frank |
last post by:
Using Python 2.2.2,
I want to catch all exceptions from "socket.gethostbyaddr(ip)"
From IDLE, I can generate:
>>> socket.gethostbyaddr('1.2')
Traceback (most recent call last):
File "<pyshell#28>", line 1, in ?
socket.gethostbyaddr('1.2')
herror: (11004, 'host not found') <=== what I want when I catch
|
by: Michele |
last post by:
Ho una funzione definita così:
#define CEIL(num,den) ( ((num)+(den)-1)/(den) )
e l'uso è questo;
int len;
len = CEIL(L, step);
la CEIL però difficilmente mi restituisce un numero intero anche se lo sono
num e den, come fa quindi len ad essere un int senza usare il casting?
|
by: pozz |
last post by:
Ciao a tutti,
in alcuni casi le funzioni in C sono così semplici che è meglio
definirle come delle macro. Per evitare che l'utilizzatore si
accorga di usare una macro o una funzione, avevo pensato di
scrivere la macro in questo modo:
#define mul(x,y) {x*y;}
In questo modo, chiunque utilizzi la mia macro potrà scrivere
|
by: Lloyd Dupont |
last post by:
I'm trying to print some of my document.
The problem is, the rendering of the document is not done through GDI+ at all but through plain old GDI, and I need it like that as I am using Uniscribe to layout text.
Anyway, when printing the text is completely out of place, I wonder if it's due to incorrrect Dpi settings? (or something else?)
I will investigate that.....
Anyway if any of you had similar experience and could shed some light?...
| |
by: Mr. B |
last post by:
VB.net 2003 c/w Framework 1.1 and MS Access db
We have a commercial program that does our Acounting and Time Sheets
(Timberline). At least once a day our Accounting department runs a Script
file that Exports info into an MS Access db file and which has 7 Tables (stuff
like Project info, Project numbers, User names, etc).
I wrote a Time Sheet entry application to read this info and to allow
Employees to write their Time Sheet data into...
|
by: jokerman |
last post by:
I want to grab the amount of images in each <subnumber> section. How?
I have this code in Flash;
var pArray = new Array();
var tArray = new Array();
var myXML:XML = new XML();
myXML.ignoreWhite = true;
myXML.onLoad = function (success:Boolean):Void {
|
by: oddbande |
last post by:
We have just upgraded a test enviroment to db2 9, and have set both the
notifylevel and diaglevel to 3. But even so I get a lot of these
messages in my db2diag.log:
2006-11-02-00.10.11.951000+060 I326548H465 LEVEL: Info
PID : 3008 TID : 4072 PROC : db2dasstm.exe
INSTANCE: DB2 NODE : 000
APPID : *LOCAL.DB2.061101231048
FUNCTION: DB2 UDB, DRDA Communication Manager, sqljcReceive,...
|
by: michele.binetti |
last post by:
Ciao a tutti,
accedendo, per la prima volta, ad una pagina contenuta in un iframe
non ho problemi.
se riaccedo alla stessa, per la seconda volta, Internet Explorer mi da
questa segnalazione: Errore:Prevista Funzione.
la pagina contiene alcune semplici funzione che verificazno il
contenuto di alcuni campi e li disabilitano.
Ma cosa vuol dire, Prevista Funzione?
grazie a tutti
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |